package com.zxmc.server.mapper;

import com.zxmc.pojo.entity.Novel;
import com.zxmc.pojo.entity.NovelType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NovelTypeMapper {
    @Insert("insert into novel_type (novel_id, value)" +
            " values (#{novelId},#{value});")
    void insert(NovelType novelType);

    @Select("select * from novel_type where novel_id=#{novelId};")
    List<NovelType> listById(Integer novelId);

    @Select("select * from novel_type;")
    List<NovelType> list();

    @Delete("delete from novel_type where novel_id=#{id};")
    void deleteByNovel(Novel novel);
}
